# !/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :get_log.py
# @Time      :2024/12/3 17:06:51
# @Author    :flower

import logging.config

import os

# # 确保路径正确指向你的 logging.ini 文件
# log_config_path = os.path.join(os.path.dirname(__file__), 'get_log.ini')
# logging.config.fileConfig(log_config_path)

# 读取并应用配置文件
# logging.config.fileConfig('../get_log.ini', encoding='utf-8')
import sys

logging.config.fileConfig(os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))+os.sep+'get_log.ini', encoding='utf-8')

# 创建一个日志记录器对象
logger = logging.getLogger(__name__)

if __name__ == '__main__':
    # logger.info('infor日志9665')
    print(os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))+os.sep+'get_log.ini')
